#ifndef CANVAS_H
#define CANVAS_H

#include "raycaster.h"

#include <QImage>

class Canvas
{
public:
    Canvas(QList<QSharedPointer<CSGNode> > *nodes);
    ~Canvas();
    void update_image();
    QImage *get_image();
    unsigned char* get_bits();
    void set_nodes(QList<QSharedPointer<CSGNode> > *nodes);
    void move_observer(glm::vec3 move_dir);
    void rotate_view(glm::vec3 rotate_vec, float angle);
private:
    RayCaster *m_ray_caster;
    QImage *m_image;
    QList<QSharedPointer<CSGNode> > *m_nodes_ptr;
    unsigned short m_width;
    unsigned short m_height;
};

#endif // CANVAS_H
